<!DOCTYPE html >
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../admin/authority.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="headScriptSM.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/sm/cs12003script.js"></script>
</head>
<body>
<input type="hidden" id="url_address" name="url_address" value="">
<input type="hidden" id="agent_browser" name="agent_browser" value="">
	<div class="wrapper">
		<!-- BEGIN Top-Bar -->
		<%@ include file="../fragments/header.jsp"%>
		<!-- END Top-Bar -->

		<div id="detail-area" class="clearfix">
			<!-- BEGIN SIDEMENU -->
			<div class="hidden-xs hidden-sm page-sidebar" id="side-menu-bar">
				<ul class="page-sidebar-menu">					

					<!-- <div id="displaymenu"></div>  -->
					<%@ include file="../admin/menu.jsp" %>

				</ul>
			</div>
		<!-- End Side Menu -->
		<div class="col-sm-12 col-xs-12" id="right-side">
			<div id="navigator-bar"><i class="fa fa-home"></i> หน้าหลัก <i class="fa fa-angle-right ml-5 mr-5"></i>บันทึกข้อมูลอัตราค่าน้ำ</div><!--End navigator-bar-->
			<!-- Start detail-area -->
			<div>
				<div id="page-header" class="clearfix">
					<div>บันทึกข้อมูลอัตราค่าน้ำ</div>
				</div>
				<!-- Start form-detail -->
				<div class="form-detail clearfix">
					<form role="form">
						<div class="search-box  no-radius">
							<div class="form-group clearfix search-header no-radius">
								<div class="pull-left">เพิ่มข้อมูลอัตราค่าน้ำ</div>
								<div class="pull-right">
									<div id="hide-button"><i class="fa fa-chevron-circle-up"></i></div>
								</div>
							</div>
							<div id="box-body">
								<div class="form-group clearfix mt-20">
									<table style="width:100%; padding: 10;">
										<tr>
											<td colspan="5">&nbsp;</td>
										<tr>
										<tr>
											<td>&nbsp;&nbsp;&nbsp;<label for="inputWaterTo">น้ำใช้ตั้งแต่ (>=ลบ.ม.)</label></td>
											<td>&nbsp;&nbsp;<label for="inputWaterEnd">น้ำใช้ถึง (<=ลบ.ม.)</label></td>
											<td>&nbsp;&nbsp;<label for="inputWaterRate">อัตราค่าน้ำ (บาท)</label></td>
											<td>&nbsp;&nbsp;<label for="inputWaterBase">ฐานน้ำ</label></td>
											<td>&nbsp;&nbsp;<label for="inputWaterBaseCharge">ฐานเงิน (บาท)</label></td>
										</tr>
										<tr>
											<td align="center"><input type="text" class="form-control" id="inputWaterTo" name="waterTo" style="text-align: right; width:90%;"></td>
											<td align="center"><input type="text" class="form-control" id="inputWaterEnd" name="waterEnd" style="text-align: right; width:90%;"></td>
											<td align="center"><input type="text" class="form-control" id="inputWaterRate" name="waterRate" style="text-align: right; width:90%;"></td>
											<td align="center"><input type="text" class="form-control" id="inputWaterBase" name="waterBase" style="text-align: right; width:90%;" ></td>
											<td align="center"><input type="text" class="form-control" id="inputWaterBaseCharge" name="waterBaseCharge" style="text-align: right; width:90%;" ></td>
										</tr>
									</table>
								</div>
								<div class="form-group mt-20 clearfix search-footer no-radius">
									<div class="col-sm-12 text-center">
										<button type="button" class="btn btn-primary" onclick="SaveCommand()"><i class="fa fa-floppy-o"></i> บันทึก</button>
										<button type="button" class="btn btn-primary" id="refresh"><i class="glyphicon glyphicon-refresh"></i> ล้างข้อมูล</button>
									</div>
								</div>
							</div>
							<!--  
							##### Backup Old Layout #####
							<div id="box-body">
								<div class="form-group clearfix mt-20">
									<div class="col-sm-2 mt-5">
									</div>
									<div class="col-sm-2 mt-5">
										<div class="pull-left mt-5 ml-10" style="width:150px;">
											<label for="inputWaterTo">น้ำใช้ตั้งแต่ (>=ลบ.ม.)</label>
									 		<input type="text" class="form-control" id="inputWaterTo" name="waterTo" style="text-align: right;" >
										</div>
									</div>
									<div class="col-sm-2 mt-5">
										<div class="pull-left mt-5 ml-10" style="width:150px; padding-left: 25px;">
											<label for="inputWaterEnd">น้ำใช้ถึง (<=ลบ.ม.)</label>
									 		<input type="text" class="form-control" id="inputWaterEnd" name="waterEnd" style="text-align: right;" >
										</div>
					  				</div>
									<div class="col-sm-2 mt-5">
										<div class="pull-left mt-5 ml-10" style="width:150px; padding-left: 25px;">
											<label for="inputWaterRate">อัตราค่าน้ำ (บาท)</label>
									 		<input type="text" class="form-control" id="inputWaterRate" name="waterRate" style="text-align: right;" >
										</div>
					  				</div>
					  				<div class="col-sm-2 mt-5">
										<div class="pull-left mt-5 ml-10" style="width:150px; padding-left: 25px;">
											<label for="inputWaterBase">ฐานค่าน้ำ (บาท)</label>
									 		<input type="text" class="form-control" id="inputWaterBase" name="waterBase" style="text-align: right;" >
										</div>
					  				</div>
					  				<div class="col-sm-2 mt-5">
										<div class="pull-left mt-5 ml-10" style="width:150px; padding-left: 25px;">
											<label for="inputWaterBaseCharge">ฐานค่าเงิน (บาท)</label>
									 		<input type="text" class="form-control" id="inputWaterBaseCharge" name="waterBaseCharge" style="text-align: right;" >
										</div>
					  				</div>
								</div>
								<div class="form-group mt-20 clearfix search-footer no-radius">
									<div class="col-sm-12 text-center">
										<button type="button" class="btn btn-primary" onclick="SaveCommand()"><i class="fa fa-floppy-o"></i> บันทึก</button>
										<button type="button" class="btn btn-primary" id="refresh"><i class="glyphicon glyphicon-refresh"></i> ล้างข้อมูล</button>
									</div>
								</div>
							</div>
							-->
							<!-- END BOX-BODY -->
						</div>
					</form>
				</div>
				<div class="form-detail clearfix" style="margin-bottom:-40px; padding:20px 15px; padding-top:0px;">
					<form class="form-inline" role="form">
						<div style="text-align:right">
							<div class="form-group clearfix">
   								<label  for="inputCustomerClass"> ประเภทผู้ใช้น้ำ : </label>
   								<select class="form-control" id="inputCustomerClass" onchange="renderDataTable()">
									<option value="">-- เลือกประเภทผู้ใช้น้ำ --</option>
									<option value="01">ผู้ใช้น้ำในเขตเทศบาล</option>
									<option value="02">ผู้ใช้น้ำนอกเขตเทศบาล</option>
								</select>
 							</div>
						</div>
					</form>
				</div>
				<!-- End detail-area -->
			</div>
			<!-- End detail-area -->
			<div class="form-detail clearfix" style="margin-top:-20px;padding-top: 0px;">
				<div class="form-list" id="form-list" >
					<form role="form" name="form" action="" method="POST">
						<div class="list-detail-area">						
						<table id="calRateDataTable" class="stripe hover cell-border" cellspacing="0" width="100%" align="center">
        					<thead>
            					<tr style="background-color: #399bca; color:white; font-size: 0.9em;">
                					<th style="border-right: 1px solid #999" class="text-center">ลำดับ</th>
									<th style="border-right: 1px solid #999" class="text-center">น้ำใช้ตั้งแต่ (>=ลบ.ม.)</th>
									<th style="border-right: 1px solid #999" class="text-center">น้ำใช้ถึง (<=ลบ.ม.)</th>
									<th style="border-right: 1px solid #999" class="text-center">อัตราค่าน้ำ (บาท)</th>
									<th style="border-right: 1px solid #999" class="text-center">ฐานน้ำ</th>
									<th style="border-right: 1px solid #999" class="text-center">ฐานเงิน (บาท)</th>
									<th class="text-center">จัดการ</th>
            					</tr>
        					</thead> 						
    					</table>
    					<input type="hidden" name="oldCodeID" id="oldCodeID" value=""/>	
    					<input type="hidden" name="oldCodeID2" id="oldCodeID2" value=""/>
    					<input type="hidden" name="oldCustomerClass" id="oldCustomerClass" value=""/>
    					
    					<input type="hidden" name="dataDelete1" id="dataDelete1" value=""/>
    					<input type="hidden" name="dataDelete2" id="dataDelete2" value=""/>	
    					
						</div>	
					</form>
					<div class="modal fade" id="confirmUpdateModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
					   	<div class="modal-dialog" style="width: 400px;">
					        <div class="modal-content">
					            <div class="modal-header">
					            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					            <h4 class="modal-title">บันทึกข้อมูลอัตราค่าน้ำ</h4>
					            </div>
					            <div class="modal-body">
					            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
					            	<span id="modal_content_confirmUpdateModal"></span>
					            </div>
					            <div class="modal-footer">
					                <button onclick="updateDataTable()" type="button"  class="btn btn-primary"><i class="fa fa-floppy-o"></i> บันทึก</button>
					                <button onclick="cancel()" type="button" class="btn btn-danger" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> ยกเลิก</button>
					        	</div>
					    	</div>
					  	</div>
					</div>
					<div class="modal fade" id="confirmSaveModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
					    <div class="modal-dialog" style="width: 400px;">
					        <div class="modal-content">
					            <div class="modal-header">
					            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					            <h4 class="modal-title">บันทึกข้อมูลอัตราค่าน้ำ</h4>
					            </div>
					            <div class="modal-body">
					            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
					            	<span id="modal_content_confirmSaveModal"></span>
					            </div>
					            <div class="modal-footer">
					                <button onclick="addDataTable()" type="button"  class="btn btn-primary"><i class="fa fa-floppy-o"></i> บันทึก</button>
					                <button onclick="cancel()"  type="button" class="btn btn-danger" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> ยกเลิก</button>
					        	</div>
					    	</div>
					  	</div>
					</div>
					<div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
					    <div class="modal-dialog" style="width: 400px;">
					        <div class="modal-content">
					            <div class="modal-header">
					            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					            <h4 class="modal-title">ลบข้อมูลอัตราค่าน้ำ</h4>
					            </div>
					            <div class="modal-body">
					            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
					            	<span id="modal_content_confirmModal"></span>
					            </div>
					            <div class="modal-footer">
					                <button onclick="confirmdeleteData()" type="submit"  class="btn btn-primary"><i class="fa fa-floppy-o"></i> ยืนยัน</button>
					                <button onclick="cancel()" type="button" class="btn btn-danger" data-dismiss="modal"><i class="glyphicon glyphicon-floppy-remove"></i> ยกเลิก</button>
					        	</div>
					    	</div>
					  	</div>
					</div>
					<div class="modal fade" id="warningModal" tabindex="-1" role="dialog" aria-labelledby="warningModal" aria-hidden="true">
				  	  <div class="modal-dialog" style="width: 400px;">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">กรุณากรอกข้อมูลให้ครบถ้วน</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span id="modal_content"></span>
				            </div>
				            <div class="modal-footer" style="text-align: center;">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="glyphicon glyphicon-ok"></i> ตกลง</button>    
				        	</div>
				    	</div>
				  	</div>
				</div>
				<div class="modal fade" id="errorModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
				    <div class="modal-dialog" style="width: 400px;">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">ผิดพลาด</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style=" color:#FC0"> <i class="fa fa-exclamation-triangle fa-stack-2x"></i></span>
				            	<span id="modal_content_errorModal"></span>
				            </div>
				            <div class="modal-footer" style="text-align: center;">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="glyphicon glyphicon-ok"></i> ตกลง</button>
				        	</div>
				    	</div>
				  	</div>
				</div>
				<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="confirmModal" aria-hidden="true">
				    <div class="modal-dialog" style="width: 400px;">
				        <div class="modal-content">
				            <div class="modal-header">
				            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				            <h4 class="modal-title">สำเร็จ</h4>
				            </div>
				            <div class="modal-body">
				            	<span class="fa-stack fa-lg mr-10" style="color:#0C0"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-check fa-stack-1x fa-inverse"></i> </span>
				            	<span id="modal_content_successModal"></span>
				            </div>
				            <div class="modal-footer" style="text-align: center;">
				                <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="glyphicon glyphicon-ok"></i> ตกลง</button>
				        	</div>
				    	</div>
				  	</div>
				</div>
			</div>
		</div>
		<div id="footer-detail">Copyright © สงวนลิขสิทธิ์ พ.ศ.2557 โดย การประปานครหลวง</div>
	</div>
</div>
 <!-- End Detail-area-->

</div>
<!-- End Wrapper -->
</body>
</html>